﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UboxUI;

namespace User
{
    public partial class FrmUserLogin : FrmUser_Father
    {
        public FrmUserLogin()
        {
            InitializeComponent();
            this.ban01.BringToFront();
            this.BtnClose.Left = Screen.PrimaryScreen.WorkingArea.Width - this.BtnClose.Width-12;
            this.BtnNarrow.Left = this.BtnClose.Left - this.BtnNarrow.Width - 5;
            this.ban01.Top = 0;

            this.panlogin.Left = (Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.panlogin.Width / 2);
            this.panlogin.Top = (Screen.PrimaryScreen.WorkingArea.Height / 2) - (this.panlogin.Height / 2);
            this.pansign.Left = (Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.pansign.Width / 2);
            this.pansign.Top = Screen.PrimaryScreen.WorkingArea.Width;
            this.pansign.Top = Screen.PrimaryScreen.WorkingArea.Height;
            this.pansign.Visible = false;

        }

        private void timerflow_Tick(object sender, EventArgs e)
        {
            if (this.picflow.Top > -2500)
            { this.picflow.Top -= 5; }
            if (this.picflow.Top < -1800)
            { this.picflow.Top = 0; }
        }

        private void timersign_Tick(object sender, EventArgs e)
        {
            if (this.pansign.Visible == true) 
            {
                this.pansign.Top -= 25;
            }
            if (pansign.Top <= (Screen.PrimaryScreen.WorkingArea.Height / 2) - (this.pansign.Height / 2) + 65) 
            {
                this.pansign.Top = (Screen.PrimaryScreen.WorkingArea.Height / 2) - (this.pansign.Height / 2) + 65;
                timersign.Enabled = false;
            }
        }

        private void btnsign_Click(object sender, EventArgs e)
        {
            timersign.Enabled = true;
            this.pansign.Visible = true;
            this.pansign.Top = Screen.PrimaryScreen.WorkingArea.Height;
            this.pansign.Left = (Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.pansign.Width / 2);
        }

        private void btncancer_Click(object sender, EventArgs e)
        {
            this.pansign.Visible = false;
        }
    }
}
